import { h } from 'vue';
import { AdColumn } from '@/components/AdTable';
import { expandAndToString } from '@/utils/common';
import { BasicUpload } from '@/components/Upload';
import { TableImg } from '@/components/Table';
import { uploadApi, deleteApi } from '@/api/sys/upload';
import { FileInfo } from '@/components/Upload/src/typing';
import { ImageSelector } from '@/components/ImageSelector';
import { List } from '@/components/Linqts';
import { isArray, isNull, isObject, isString } from '@/utils/is';
import FileUpload from '/@/components/Form/src/components/FileUpload.vue';
import { debug } from 'console';
import { readNode } from './saler.api';

export const columns: AdColumn[] = [
  {
    title: '主键',
    dataIndex: 'Id',
    dataType: 'guid',
    width: 300,
    defaultHidden: true,
    filterable: false,
    sorter: true,
    formVisible: true,
    formEditable: false,
  },
  {
    title: '姓名',
    dataIndex: 'Name',
    dataType: 'string',
    width: 150,
    formVisible: true,
    formEditable: true,
    required: true,
    filterable: true,
    sorter: true,
  },
  {
    title: '手机号',
    dataIndex: 'Phone',
    dataType: 'mobile',
    width: 150,
    formVisible: true,
    formEditable: true,
    required: true,
    filterable: true,
    sorter: true,
  },
  {
    title: '邮箱',
    dataIndex: 'Email',
    dataType: 'email',
    width: 150,
    formVisible: true,
    formEditable: true,
    required: true,
    filterable: true,
    sorter: true,
  },
  {
    title: '区域名称',
    dataIndex: 'AreaName',
    dataType: 'string',
    width: 150,
    formVisible: false,
    formEditable: false,
  },
  {
    title: '区域代码',
    dataIndex: 'AreaCode',
    dataType: 'string',
    width: 150,
    defaultHidden: true,
    formVisible: true,
    formEditable: true,
    required: true,
    filterable: true,
    sorter: true,
    editComponent: 'ApiSelect',
    editComponentProps: {
      api: readNode,
      // use name as label
      labelField: 'Desc',
      // use id as value
      valueField: 'Code',
      immediate: true,
      optionFilterProp: 'label',
      showSearch: true,
    },
  },
  {
    title: '创建时间',
    dataIndex: 'CreatedTime',
    dataType: 'datetime',
    width: 200,
    formVisible: true,
    formEditable: false,
    required: false,
    filterable: true,
    sorter: true,
  },
];

export interface InputDto {}

export interface OutputDto {}
